Optimal. Leaf size=62 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)-\frac{2 a b \cos (c+d x)}{d}+\frac{b^2 \sin (c+d x)}{d^2}-\frac{b^2 x \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.182651, antiderivative size = 62, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.412, Rules used = {6742, 2638, 3303, 3299, 3302, 3296, 2637} \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)-\frac{2 a b \cos (c+d x)}{d}+\frac{b^2 \sin (c+d x)}{d^2}-\frac{b^2 x \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 6742
Rule 2638
Rule 3303
Rule 3299
Rule 3302
Rule 3296
Rule 2637
Rubi steps
\begin{align*} \int \frac{(a+b x)^2 \sin (c+d x)}{x} \, dx &=\int \left (2 a b \sin (c+d x)+\frac{a^2 \sin (c+d x)}{x}+b^2 x \sin (c+d x)\right ) \, dx\\ &=a^2 \int \frac{\sin (c+d x)}{x} \, dx+(2 a b) \int \sin (c+d x) \, dx+b^2 \int x \sin (c+d x) \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x \cos (c+d x)}{d}+\frac{b^2 \int \cos (c+d x) \, dx}{d}+\left (a^2 \cos (c)\right ) \int \frac{\sin (d x)}{x} \, dx+\left (a^2 \sin (c)\right ) \int \frac{\cos (d x)}{x} \, dx\\ &=-\frac{2 a b \cos (c+d x)}{d}-\frac{b^2 x \cos (c+d x)}{d}+a^2 \text{Ci}(d x) \sin (c)+\frac{b^2 \sin (c+d x)}{d^2}+a^2 \cos (c) \text{Si}(d x)\\ \end{align*}
Mathematica [A] time = 0.287847, size = 51, normalized size = 0.82 \[ a^2 \sin (c) \text{CosIntegral}(d x)+a^2 \cos (c) \text{Si}(d x)+\frac{b (b \sin (c+d x)-d (2 a+b x) \cos (c+d x))}{d^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.01, size = 79, normalized size = 1.3 \begin{align*}{\frac{ \left ( 1+c \right ){b}^{2} \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}-2\,{\frac{ab\cos \left ( dx+c \right ) }{d}}+2\,{\frac{c{b}^{2}\cos \left ( dx+c \right ) }{{d}^{2}}}+{a}^{2} \left ({\it Si} \left ( dx \right ) \cos \left ( c \right ) +{\it Ci} \left ( dx \right ) \sin \left ( c \right ) \right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [C] time = 2.09114, size = 108, normalized size = 1.74 \begin{align*} \frac{{\left (a^{2}{\left (-i \,{\rm Ei}\left (i \, d x\right ) + i \,{\rm Ei}\left (-i \, d x\right )\right )} \cos \left (c\right ) + a^{2}{\left ({\rm Ei}\left (i \, d x\right ) +{\rm Ei}\left (-i \, d x\right )\right )} \sin \left (c\right )\right )} d^{2} + 2 \, b^{2} \sin \left (d x + c\right ) - 2 \,{\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right )}{2 \, d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.64999, size = 230, normalized size = 3.71 \begin{align*} \frac{2 \, a^{2} d^{2} \cos \left (c\right ) \operatorname{Si}\left (d x\right ) + 2 \, b^{2} \sin \left (d x + c\right ) - 2 \,{\left (b^{2} d x + 2 \, a b d\right )} \cos \left (d x + c\right ) +{\left (a^{2} d^{2} \operatorname{Ci}\left (d x\right ) + a^{2} d^{2} \operatorname{Ci}\left (-d x\right )\right )} \sin \left (c\right )}{2 \, d^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.75537, size = 90, normalized size = 1.45 \begin{align*} a^{2} \sin{\left (c \right )} \operatorname{Ci}{\left (d x \right )} + a^{2} \cos{\left (c \right )} \operatorname{Si}{\left (d x \right )} + 2 a b \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) + b^{2} x \left (\begin{cases} - \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\cos{\left (c + d x \right )}}{d} & \text{otherwise} \end{cases}\right ) - b^{2} \left (\begin{cases} - x \cos{\left (c \right )} & \text{for}\: d = 0 \\- \frac{\begin{cases} \frac{\sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \cos{\left (c \right )} & \text{otherwise} \end{cases}}{d} & \text{otherwise} \end{cases}\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]